
<?php 
  $id=$_GET['id'];
// var_dump($_POST);
//第一步连接数据库服务器；
@mysql_connect('localhost','root','root');
//第二步判断是否正确连接；
if (mysql_errno()) {
  die(mysql_error());
}
//第三步选择数据库
 mysql_select_db('photo');
//第四步设置字符集
 mysql_set_charset('utf8');
//第五步写入SQL语句
  $sql ="select * from photo where id='$id'";
 
 
  //第六步 发送SQL语句到MYSQL服务器
  $res = mysql_query($sql);
  //第七部处理结果集
 
   while ( $row =mysql_fetch_assoc($res)) {

     $a=$row['title'];
     $b=$row['content'];
     $c=$row['src'];
}

 ?>










<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>添加相册</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
      <!-- 导航条-->
		<nav class="navbar navbar-inverse">
		  <div class="container-fluid">
		  <div class="navbar-header">
		      <a class="navbar-brand" href="./photo.php">
		        <img alt="在线相册" src="...">
		      </a>
		  </div>
		  </div>
		</nav>

		    <!-- 主体内容-->
<div class="container">
	<div class="row">
	<div class="col-md-6 col-md-offset-3">
	  <form action="UP.php" method="post"> 
	    <input  type="hidden" value="<?php echo $id; ?>" name="id"> 
		  <div class="form-group">
		    <label for="exampleInputEmail1">相册标题</label>
		    <input type="text" class="form-control" id="exampleInputEmail1" placeholder="Email" name="names"value="<?php echo $a; ?>">
		  </div>
		  <div class="form-group">
		    <label for="exampleInputPassword1">相册内容</label>
		    <textarea  id="" cols="80" rows="8" name="content" class="control" ><?php echo $b; ?></textarea>
		  </div>
		  <div class="form-group">
		    <label for="exampleInputFile">相册文件</label>
		    <input type="file" id="exampleInputFile" value="<?php echo $c; ?>">
		    <p class="help-block">Example block-level help text here.</p>
		  </div>
		  <div class="checkbox">
		    <label>
		      <input type="checkbox"> Check me out
		    </label>
		  </div>
		  <button type="submit" class="btn btn-primary" >确认更改</button>
		
	</form>
	</div>
	</div>
</div>
  

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>